<?php
/**
 * Created by PhpStorm.
 * User: huanghai
 * Date: 2018/7/12
 * Time: 上午9:16
 */

namespace app\admin\controller;
use think\controller;
use think\Validate;
use think\Request;
use think\Db;

class Datacount extends Auto
{

    /**
     * pad用户在线日志
     */
    public function padacclog(){

        return $this->fetch();
    }

    public function padacclogquery(){
        $paramdata = ['org_code'=>session('user.org_code')];
        $result  = Db::table('pad_acc_status_log')
            ->where($paramdata)
            ->select();

        $dataarr = [
            'data'=>$result
        ];
        echo json_encode($dataarr);

    }

    /**
     * 设备连接日志
     */
    public function devicelog(){

        return $this->fetch();

    }

    public function devicelogquery(){
        $paramdata = ['org_code'=>session('user.org_code')];
        $result  = Db::table('dev_status_log')
            ->where($paramdata)
            ->select();

        $dataarr = [
            'data'=>$result
        ];
        echo json_encode($dataarr);

    }
}